home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / pc / ps40sdk / examples / common / headers.h / winutilities.h < prev   
Encoding:
C/C++ Source or Header  |  1996-09-29  |  3.3 KB  |  126 lines

  1. //  (c) Copyright 1996.  Adobe Systems, Incorporated.  All rights reserved.
  2.  
  3. #ifndef __WinUtilities_H__
  4. #define __WinUtilities_H__
  5.  
  6. #include <windows.h>
  7. #include <windowsx.h>
  8. #include <stdlib.h>
  9.  
  10. #include "PITypes.h"
  11. #include "WinDialogUtils.h"
  12.  
  13. #define noErr 0
  14. #define memFullErr (-108)
  15. #define memWZErr  (-111)
  16. #define nilHandleErr (-109)
  17.  
  18. void NumToString (const long x, Str255 s);
  19.  
  20. #ifndef __PITypes__
  21. typedef LPSTR Ptr;            /* Mac pointer type */
  22. typedef LPSTR *Handle;    /* Mac handle type */
  23. typedef short OSErr;
  24. typedef unsigned char Boolean;
  25. typedef struct
  26. {
  27.     short top;
  28.     short left;
  29.     short bottom;
  30.     short right;
  31. } Rect;
  32.  
  33. typedef struct
  34. {
  35.     short v;
  36.     short h;
  37. } Point;
  38.  
  39. #define false FALSE
  40. #define true TRUE
  41. #endif
  42.  
  43. Handle    NewHandle( long size );
  44. Handle    NewHandleClear( long size );
  45. long    GetHandleSize (Handle handle);
  46. void    SetHandleSize (Handle handle, long newSize);
  47. void    DisposHandle (Handle handle);
  48. Handle     DupHandle(Handle oldhand);
  49. void    HLock (Handle h);
  50. void    HUnlock (Handle h);
  51. void    MoveHHi (Handle h);
  52. void    DisposPtr(Ptr p);
  53. Ptr    NewPtr( long size );
  54. Ptr    NewPtrClear( long size );
  55. OSErr    MemError(void);
  56.  
  57. LPSTR WAllocBuffer(long size);
  58. VOID WFreeBuffer(LPSTR ptr);
  59. DWORD WSizeBuffer(LPSTR ptr);
  60. HANDLE HandFromPtr(LPSTR ptr);
  61.  
  62. #if 0
  63. BOOL UserInputAvail(UINT flags, BOOL newOnly);
  64. VOID DoYield(BOOL yield);
  65.  
  66. BOOL ValidateDlgLong(HWND hDlg, int item, long minVal, long maxVal, long *retVal, BOOL pin);
  67. BOOL UserChangedEditText(HWND hDlg, WPARAM wParam, LPARAM lParam);
  68. void InitEditWnd(HWND hDlg, int id);
  69. void EditFail(HWND hDlg, int id, BOOL issigned, BOOL inedit);
  70.  
  71. VOID CenterWindow(HWND hChild, WORD wHow);
  72. /* Defines for CenterWindow */
  73. #define CW_HORZ     0x0001
  74. #define CW_VERT     0x0002
  75. #define CW_BOTH     0x0003
  76. #define CW_V1THIRD  0x0010
  77. #define CW_CLIENT   0x0000
  78. #define CW_SCREEN   0x0100
  79.  
  80. VOID MapRect(LPRECT lprct, HWND srcw, HWND destw);
  81. VOID GetDlgItemRect(HWND hDlg, int item, LPRECT lprct);
  82. void    InitCursor( void );
  83. void InitHypotTable(unsigned short *HypotTable);
  84. short Hypot(unsigned short *HypotTable,register short x,register short y);
  85.  
  86. #endif
  87.  
  88. Boolean PISetRect(Rect* pRect, short nLeft, short nTop, short nRight, short nBottom);
  89. Boolean PIOffsetRect(Rect* pRect, short xAmt, short yAmt);
  90. Boolean PIPtInRect(Point pt, Rect* r);
  91. Boolean PIInsetRect(Rect *pRect, short xAmt, short yAmt);
  92. Boolean EmptyRect( Rect *pRect );
  93.  
  94. long    TickCount();
  95. short    Random( void );
  96.  
  97. /****************************************************************************/
  98.  
  99. /* Initialization and termination code for window's dlls. */
  100.  
  101. // Win32 Change
  102. #ifdef WIN32
  103.  
  104. // Every 32-Bit DLL has an entry point DLLInit
  105.  
  106. BOOL APIENTRY DLLInit(HANDLE hInstance, DWORD fdwReason, LPVOID lpReserved);
  107.  
  108. #else
  109. /* ------------------------------------------------
  110.  *   Code from Borland's window's dll example code.
  111.  * ------------------------------------------------
  112.  */
  113. #if defined(__BORLANDC__)
  114. // Turn off warning: Parameter '' is never used; effects next function only
  115. #pragma argsused
  116. #endif
  117.  
  118. // Every DLL has an entry point LibMain and an exit point WEP.
  119. int FAR PASCAL LibMain( HANDLE hInstance, WORD wDataSegment,
  120.                                    WORD wHeapSize, LPSTR lpszCmdLine );
  121.  
  122. int FAR PASCAL WEP(int nParam);
  123. #endif
  124.  
  125. #endif /* __WinUtilities_H__ */
  126.